package cn.springBoot.delegate;

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;

/** 
 * @description:  Delegate Expression 类型的
 * @param:null 
 * @author: ljx
 * @create date: 2021/9/29 
 * @version: V1.0 
 * @return:  
 */
 

@Component("message")
public class MessageDelegate implements JavaDelegate {
    private final Logger LOGGER = Logger.getLogger(MessageDelegate.class.getName());

    @Override
    public void execute(DelegateExecution execution) throws Exception {
        LOGGER.info("通知客服、采购执行、销售、供应链部门");
        String message = (String) execution.getVariable("message");
        LOGGER.info("message:"+message);


        //添加会签人员
        System.out.println("%%%%%%%%%%%%%%%添加会签人员%%%%%%%%%%%%%%%%%%%");
        List<String> userList = new ArrayList<>();
        userList.add("user1");
        userList.add("user2");
        userList.add("user3");
        execution.setVariable("assigneeList", userList);
        System.out.println("%%%%%%%%%%%%%%%添加结束%%%%%%%%%%%%%%%%%%%");
    }




}
